package me.zhengjie.monitor.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.monitor.domain.Visits;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author jie
 * @date 2018-12-13
 */
public interface VisitsMapper extends BaseMapper<Visits> {

    /**
     * findByDate
     * @param date
     * @return
     */
    @Select("select * from visits where date = #{date}")
    Visits findByDate(String date);

    /**
     * 获得一个时间段的记录
     * @param date1
     * @param date2
     * @return
     */
    @Select("select * FROM visits where createTime between #{data1} and #{data2}")
    List<Visits> findAllVisits(@Param("data1") String date1, @Param("data2") String date2);
}
